<?
	//include_once './misspellCorrection.php';
		
		function keyWords($posts)
		{
			$result = array();
			foreach($posts as $post)
			{
				$message = $post -> message;
				foreach($message['sentences'] as $sentence)
				{
					foreach($sentence['text'] as $word)
					{
						$result[$word]['s_value'] = $result[$word]['s_value'] + $sentence['s_value'];
						$result[$word]['occ']++;
/*						if($sentence['s_value'] == 1)
							$result[$word]['occ_positive']++;
						else if ($sentence['s_value'] == 0)
							$result[$word]['occ_negative']++;
						else
							$result[$word]['occ_neutral']++;*/						
					}
				}				
			}
			echo "Array from KeyWord Function: <br>".print_r($result,true)."<br><br><br><br>";
			return $result;
			

		}

?>